<%--
  Created by IntelliJ IDEA.
  User: 29688
  Date: 2021/3/22
  Time: 13:33
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>首页</title>
    <link rel="stylesheet" href="../../layui-v2.5.7/layui/css/layui.css">
    <script src="../../layui-v2.5.7/layui/layui.js"></script>
    <script src="../../js/jquery.js"></script>
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <div class="layui-header ">
        <div class="layui-logo">校园纸质处理系统</div>
        <!-- 头部区域（可配合layui已有的水平导航） -->
        <ul class="layui-nav layui-layout-left ">
            <li class="layui-nav-item"><a href="/user/order" target="mainBody">历史订单</a></li>
            <li class="layui-nav-item"><a href="/user/chart" target="mainBody">购物车管理</a></li>
        </ul>
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item" lay-unselect>
                <a href="/user/message" target="mainBody" layadmin-event="message" lay-text="消息中心">
                    <i class="layui-icon layui-icon-notice"></i>
                    <!-- 如果有新消息，则显示小圆点 -->
                    <c:if test="${sessionScope.messageCount>0}">
                        <span class="layui-badge-dot"></span>
                    </c:if>

                </a>
            </li>
            <li class="layui-nav-item">
                <a href="javascript:;">
                    <img src="${sessionScope.userInfo.url}"  class="layui-nav-img" id="picture">
                    ${sessionScope.user.uname}
                </a>
                <dl class="layui-nav-child">
                    <dd><a href="/user/userInfoUpdate" target="mainBody">基本资料</a></dd>
                    <dd><a href="/user/passwordUpdate" target="mainBody">修改密码</a></dd>
                </dl>
            </li>
            <li class="layui-nav-item"><a href="/user/quit">注销</a></li>
        </ul>
    </div>

    <div class="layui-side ">
        <div class="layui-side-scroll layui-bg-black">
            <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
            <ul class="layui-nav layui-nav-tree layui-bg-black" lay-filter="test">
                <li class="layui-nav-item layui-nav-itemed">
                    <a class="layui-this" href="/book/toList" target="mainBody">淘书</a>
                </li>
                <li class="layui-nav-item layui-nav-itemed">
                    <a  href="/user/book/add" target="mainBody">售书</a>
                </li>
                <c:if test="${sessionScope.user.rid==1}">
                    <li class="layui-nav-item layui-nav-itemed">
                        <a class="" href="javascript:;">管理</a>
                        <dl class="layui-nav-child">
                            <dd><a href="/user/userEdit" target="mainBody">用户管理</a></dd>
                            <dd><a href="/book/bookEdit" target="mainBody">书籍管理</a></dd>
                            <dd><a href="/type/typeEdit" target="mainBody">书籍类型</a></dd>
                            <dd><a href="/type/typeEdit" target="mainBody">日志管理</a></dd>
                            <dd><a href="/admin/messageEdit" target="mainBody">公告管理</a></dd>
                            <dd><a href="/admin/logEdit" target="mainBody">日志查看</a></dd>
                        </dl>
                    </li>
                    <li class="layui-nav-item layui-nav-itemed">
                        <a class="" href="javascript:;">审核</a>
                        <dl class="layui-nav-child">
                            <dd><a href="/book/bookCheck" target="mainBody">书籍审核</a></dd>
                        </dl>
                    </li>
                </c:if>
            </ul>
        </div>
    </div>

    <div class="layui-body">
        <%--主体内容区域--%>
        <iframe src="" id="mainBody" height="100%" width="100%" name="mainBody">
        </iframe>
    </div>
</div>

<script>
    window.onload = function () {
        $("#mainBody").attr('src', "/book/toList")
    }
    layui.use('element', function () {
        var element = layui.element;
    });
</script>
</body>
</html>
